package com.heima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heima.pojo.domain.Order;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;

@Mapper
public interface OrderMapper extends BaseMapper<Order> {

    @Select("select COUNT(*) from tb_order where create_time between #{start} and #{end}")
    Integer selectOrderCount(LocalDateTime start, LocalDateTime end);

    @Select("select SUM(amount) from tb_order where create_time between #{start} and #{end}")
    Integer selectOrderAmount(LocalDateTime start, LocalDateTime end);
}
